Skip to main content

FlagEmoji API

FlagEmoji is component for rendering country flag. It's used in CountrySelector and CountrySelectorDropdown components.

Usage Example

Import component

import { FlagEmoji } from 'react-international-phone';

Use by providing the dialCode and prefix properties.

<FlagEmoji iso2="ua" size="30px" />

Output:

Properties

PropTypeDescriptionDefault value
iso2 *stringiso2 code of country flag
srcstringCustom src of flagundefined
protocol"http" | "https"Protocol to use with twemoji cnd"https"
disableLazyLoadingbooleanDisable lazy loading of flags (loading="lazy" attribute will not be set)undefined

Style properties

PropTypeDescription
sizeCSSProperties['width']Size of flag (set width and height)
styleCSSPropertiesCustom styles prop
classNamestringCustom className prop

CSS variables

VariableDefault value
--react-international-phone-flag-width24px
--react-international-phone-flag-height24px